<template>
  <div>
    <div :class="sticky ? 'sticky' : ''" id="topNavBar" class="topNavBar">
      <div class="topNavBar-inner clearfix">
        <a class="logo" href="#" alt="logo" style="float: left;">
          <span class="rs">在线简历</span>
        </a>
        <nav class="menu" style="float: right;">
          <ul class="clearfix">
            <li>
              <a href="#siteAbout">关于</a>
            </li>
            <li>
              <a href="#siteSkills">技能</a>
            </li>
            <li>
              <a href="#siteWorks">作品</a>
              <ul class="submenu">
                <li>作品1</li>
                <li>作品2</li>
                <li>作品3</li>
              </ul>
            </li>
            <li>
              <a href="#">博客</a>
              <ul class="submenu">
                <li>博客1</li>
                <li>博客2</li>
                <li>博客3</li>
              </ul>
            </li>
            <li>
              <a href="#">日历</a>
            </li>
            <li>
              <a href="#">联系方式</a>
            </li>
            <li>
              <a href="#">其他</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
    <div class="banner">
      <div class="mask"></div>
    </div>

    <main>
      <div data-x id="siteAbout" class="userCard">
        <div class="pictureAndText clearfix">
          <div class="picture">
            <img :src="touxiang" width="299" height="347" alt="头像" />
          </div>
          <div class="text">
            <span class="welcome"
              >Hello
              <span class="triangle"></span>
            </span>
            <h1>张志斌</h1>
            <p>前端开发工程师</p>
            <hr />
            <dl>
              <dt>年龄</dt>
              <dd>24</dd>
              <dt>所在城市</dt>
              <dd>西安</dd>
              <dt>邮箱</dt>
              <dd>xiaozhang199710@163.com</dd>
              <dt>手机</dt>
              <dd>19891091420(同微信)</dd>
            </dl>
          </div>
        </div>
      </div>

      <div class="mycode">
        <div class="downloadResume-wrapper">
          <div class="downloadResume" target="_blank">
            My skills
          </div>

          <ul class="mysillsdetail">
            <li>
              <img src="https://ftp.bmp.ovh/imgs/2021/03/04e49b55b63f2f77.png" alt="" />
              <h4>熟练使用HTML，了解H5新增特性</h4>
            </li>
            <li>
              <img src="https://s3.bmp.ovh/imgs/2021/11/95426eb39c7630fa.png" alt="" />
              <h4>熟悉使用Css样式操作，了解C3新增特性</h4>
            </li>
            <li>
              <img src="https://ftp.bmp.ovh/imgs/2021/03/f6dd323ed7cec41a.png" alt="" />
              <h4>熟练使用VUE全家桶，多次使用开发项目</h4>
            </li>
            <li>
              <img src="https://s3.bmp.ovh/imgs/2021/11/4f3f5f73b3400f0c.png" alt="" />
              <h4>了解基本的react开发流程</h4>
            </li>
            <li>
              <img src="https://s3.bmp.ovh/imgs/2021/11/79aed36224ec26c2.png" alt="" />
              <h4>熟悉Node，能够利用express进行数据库的开发</h4>
            </li>
            <li>
              <img src="https://ftp.bmp.ovh/imgs/2021/03/87465020266c0bf6.png" alt="" />
              <h4>熟悉小程序，能够结合API开发小型应用</h4>
            </li>
          </ul>
        </div>
      </div>
    </main>

    <section data-x id="siteSkills" class="skills">
      <h2>技能</h2>
      <ol class="clearfix">
        <li>
          <h3>
            HTML 5 &amp; CSS 3
          </h3>
          <div class="progressBar">
            <div ref="html1" class="progress" :style="{ width: width1 }"></div>
          </div>
        </li>
        <li>
          <h3>
            JavaScript
          </h3>
          <div class="progressBar">
            <div class="progress2" :style="{ width: width2 }"></div>
          </div>
        </li>
        <li>
          <h3>
            jQuery
          </h3>
          <div class="progressBar">
            <div class="progress3" :style="{ width: width3 }"></div>
          </div>
        </li>
        <li>
          <h3>
            Vue.js
          </h3>
          <div class="progressBar">
            <div class="progress4" :style="{ width: width4 }"></div>
          </div>
        </li>
        <li>
          <h3>
            React.js
          </h3>
          <div class="progressBar">
            <div class="progress5" :style="{ width: width5 }"></div>
          </div>
        </li>
        <li>
          <h3>
            Node.js
          </h3>
          <div class="progressBar">
            <div class="progress6" :style="{ width: width6 }"></div>
          </div>
        </li>
      </ol>
    </section>

    <section class="portfolio" id="siteWorks">
      <h2>作品集</h2>
      <nav>
        <ol class="clearfix">
          <li @click="portfolio1">所有</li>
          <li @click="portfolio2">框架</li>
          <li @click="portfolio3">原生JS&amp;CSS</li>
        </ol>
        <div
          id="portfolioBar"
          :class="{
            bar: true,
            'state-1': bar1,
            'state-2': bar2,
            'state-3': bar3,
          }"
        >
          <div class="bar-inner"></div>
        </div>
      </nav>
      <router-view></router-view>
    </section>
    <Plan></Plan>
  </div>
</template>

<script>
import All from '../views/All'
import Work from '../views/Work'
import Origin from '../views/Origin'
import Plan from '../views/Plan'
export default {
  //组件名字
  name: "comfilmlisttopnav",
  //接收父组件给的东西 type是接收什么东西  default 默认值
  props: {
    list: {
      type: Array,
      default() {
        return [];
      },
    },
    color: {
      type: String,
      default: "#000",
    },
  },
  //组件注册
  components: {
    All,
    Work,
    Origin,
    Plan
  },
  // vue数据集中管理

  data() {
    return {
      value: "1",
      isbar: true,
      bar1: true,
      bar2: false,
      bar3: false,
      sticky: false,
      falg1: false,
      falg2: false,
      falg3: false,
      width1: 10 + "%",
      width2: 1 + "%",
      width3: 1 + "%",
      width4: 1 + "%",
      width5: 1 + "%",
      width6: 1 + "%",
      width7: 1 + "%",
      width8: 1 + "%",
      touxiang: "https://s3.bmp.ovh/imgs/2021/11/d8808e4d14a855a9.jpg",
    };
  },
  //方法 函数写这里
  methods: {
    portfolio1() {
      console.log("进入portfolio1");
      this.bar1 = true;
      this.bar2 = false;
      this.bar3 = false;
      this.falg1 = true;
      this.$router.push('/all')
    },
    portfolio2() {
      console.log("进入portfolio2");
      this.bar1 = false;
      this.bar2 = true;
      this.bar3 = false;
      this.falg2 = true;
      this.$router.push('/work')
    },
    portfolio3() {
      console.log("进入portfolio3");
      this.bar1 = false;
      this.bar2 = false;
      this.bar3 = true;
      this.falg3 = true;
      this.$router.push('/origin')
    },
  },
  //计算属性
  computed: {},
  //侦听器
  watch: {},
  //过滤器
  filters: {
    toUpcase(value) {
      return value ? value.toUpperCase() : "";
    },
  },
  //以下是生命周期
  //组件创建之前
  beforeCreate() {},
  //组件创建之后
  created() {},
  //页面渲染之前
  beforeMount() {},
  //页面渲染之后
  mounted() {
    window.addEventListener(
      "scroll",
      (e) => {
        console.log("我进入了scroll监听  ");
        let top = document.documentElement.scrollTop;
        if (top > 300) {
          this.width1 = 90 + "%";
        }
        if (top > 350) {
          this.width2 = 95 + "%";
        }
        if (top > 400) {
          this.width3 = 95 + "%";
        }

        if (top > 450) {
          this.width4 = 95 + "%";
        }
        if (top > 500) {
          this.width5 = 95 + "%";
        }
        if (top > 570) {
          this.width6 = 95 + "%";
        }
        console.log(top);
        //吸顶高级效果
        if (top > 200) {
          this.sticky = true;
        } else {
          this.sticky = false;
        }
      },
      true
    );
  },
  //页面销毁之前
  beforeDestroy() {},
  //页面销毁之后
  destroyed() {},
  //页面视图数据更新之前
  beforeUpdate() {},
  //页面视图数据更新之后
  updated() {},
  //组件路由守卫enter
  beforeRouteEnter(to, from, next) {
    next((vm) => {});
    // 注意，在路由进入之前，组件实例还未渲染，所以无法获取this实例，只能通过vm来访问组件实例
  },
  //组件路由守卫update更新
  beforeRouteUpdate(to, from, next) {
    // 同一页面，刷新不同数据时调用，
    next();
  },
  //组件路由守卫离开
  beforeRouteLeave(to, from, next) {
    // 离开当前路由页面时调用
    next();
  },
};
</script>

<style>
.topNavBar {
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: all 0.5s;
  color: #b7b7b7;
}
.topNavBar.sticky {
  background: white;
  padding: 10px 0;
  z-index: 1;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  color: #3d4451;
}
.topNavBar-inner {
  padding: 0 16px;
}
.topNavBar nav {
  padding-top: 5px;
}
.topNavBar nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topNavBar nav > ul > li {
  float: left;
  margin-left: 17px;
  margin-right: 17px;
  position: relative;
}
.topNavBar nav > ul > li > a {
  font-size: 12px;
  color: inherit;
  font-weight: bold;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  padding-top: 5px;
  padding-bottom: 5px;
  display: block;
  position: relative;
}
.topNavBar nav > ul > li.active > a::after,
.topNavBar nav > ul > li.highlight > a::after {
  content: "";
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #e06567;
  height: 3px;
  animation: menuSlide 0.3s;
}
@keyframes menuSlide {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}
.topNavBar .submenu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  color: #3d4451;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.topNavBar li.active > .submenu {
  display: block;
  animation: submenuSlide 0.3s;
}
@keyframes submenuSlide {
  0% {
    margin-right: 100%;
  }
  100% {
    margin-right: 0%;
  }
}
.topNavBar .submenu > li {
  white-space: nowrap;
  padding: 5px 10px;
}

.topNavBar .logo {
  font-size: 24px;
  font-family: "Arial Black";
  padding-top: 3px;
  padding-bottom: 4px;
}
.topNavBar .logo .rs {
  margin-right: 4px;
  color: #e6686a;
}
.topNavBar .logo .card {
  color: #9a9da2;
}
.banner {
  height: 515px;
  background-image: url("http://www.visitxm.com/images/bpic.jpg");
  background-position: center center;
  background-size: cover;
}
.banner .mask {
  height: 515px;
  background-color: #2e456569;
}

.userCard {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
  background-color: #ffffff;
  box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.5);
}
.userCard .welcome {
  background: #e6686a;
  color: white;
  display: inline-block;
  padding: 4px 16px;
  line-height: 22px;
  position: relative;
  margin-bottom: 10px;
}
.userCard .welcome .triangle {
  display: block;
  border: 10px solid transparent;
  width: 0px;
  border-left-color: #e6686a;
  border-top-width: 0px;
  position: absolute;
  left: 4px;
  top: 100%;
}
.userCard .picture {
  float: left;
}
.userCard .text {
  float: left;
  margin-left: 65px;
  width: 470px;
}
.userCard .text h1 {
  margin-top: 18px;
}
.userCard .text hr {
  margin: 20px 0;
}
.userCard .pictureAndText {
  padding: 50px;
}
.userCard dl dt,
.userCard dl dd {
  float: left;
  padding: 5px 0;
}
.userCard dl dt {
  width: 30%;
  font-weight: bold;
}
.userCard dl dd {
  width: 70%;
  color: #9da0a7;
}

main {
  margin-top: -340px;
}
main .downloadResume-wrapper {
  text-align: center;
  overflow: hidden;
}
main .downloadResume {
  font-size: 14px;
  line-height: 16px;
  padding: 21px 55px;
  background: skyblue;
  display: inline-block;
  border-radius: 2px;
  color: #3d4451;
  font-weight: bold;
  margin: 32px 0 0 0;
  transition: box-shadow 0.2s;
}
main .downloadResume:hover {
  box-shadow: 0px 4px 13px 0px rgba(0, 0, 0, 0.2);
}
main .mysillsdetail {
  margin: 20px auto;
  width: 90%;
  overflow: hidden;
}
main .mysillsdetail > li {
    width: 30%;
    height: 240px;
    line-height: 240px;
    min-width: 240px;
    min-height: 240px;
    float: left;
    margin: 0 15px 30px 15px;
    position: relative;
    box-sizing: border-box;
    background: #fff;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}
main .mysillsdetail > li:hover {
  box-shadow: 0px 4px 13px 0px rgba(0, 0, 0, 0.2);
}

main .mysillsdetail > li h4{
    position: absolute;
    bottom: 30px;
    left: 2%;
    right: 2%;
    line-height: 15px;
    font-size: 12px;
}


main .mysillsdetail > li::before {
  content: "";
  display: block;
  width: 107px;
  height: 107px;
  transform: rotate(0);
  transition: transform 1s ease;
  /* transition 是动画缓动 绑定  transform一旦触发改变1s内完成 ease线性 0.3s后开始 */
}

main .mysillsdetail > li:nth-child(1)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/321ce444b25260de.png);
  margin-left: -55px;
  margin-top: -55px;
  position: absolute;
  top: 50%;
  left: 50%;
}

main .mysillsdetail > li:nth-child(2)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/a44cabe3f6bb5156.png);
  margin-left: -55px;
  margin-top: -55px;
  position: absolute;
  top: 50%;
  left: 50%;
}

main .mysillsdetail > li:nth-child(3)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/af59d81640884a82.png);
  margin-left: -55px;
  margin-top: -55px;
  position: absolute;
  top: 50%;
  left: 50%;
}

main .mysillsdetail > li:nth-child(4)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/d02bb56362585d6e.png);
  margin-left: -54px;
  margin-top: -54px;
  position: absolute;
  top: 50%;
  left: 50%;
}
main .mysillsdetail > li:nth-child(5)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/a44cabe3f6bb5156.png);
  margin-left: -55px;
  margin-top: -55px;
  position: absolute;
  top: 50%;
  left: 50%;
}

main .mysillsdetail > li:nth-child(6)::before {
  background-image: url(https://ftp.bmp.ovh/imgs/2021/03/af59d81640884a82.png);
  margin-left: -55px;
  margin-top: -55px;
  position: absolute;
  top: 50%;
  left: 50%;
}

main .mysillsdetail > li img {
  position: absolute;
  width: 60px;
  height: 60px;
  top: 50%;
  left: 50%;
  margin-left: -30px;
  margin-top: -30px;
  transition: transform 0.5s ease 0s;
  /* 绑定了vue 小程序 html css图标 过渡缓动 transform触发 0.5s内 动画完成  ease 0s
            马上开始 */
  border-radius: 50%;
}

/* 背景圆环旋转一周 */
main .mysillsdetail > li:hover::before {
  transform: rotate(360deg);
}

/* 中心图标放大1.2倍 */
main .mysillsdetail > li:hover img {
  transform: scale(1.2);
}



section.skills,
section.portfolio {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 60px;
}
section.skills > h2,
section.portfolio > h2 {
  text-align: center;
  color: #3d4451;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
}
section.skills h3 {
  font-size: 14px;
  line-height: 1.1;
  padding-right: 40px;
}
section.skills > ol {
  background: white;
  box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.5);
  padding: 42px 50px 10px;
  margin-top: 30px;
}
section.skills > ol > li {
  float: left;
  width: 98%;
  box-sizing: border-box;
}
section.skills > ol > li:nth-child(even) {
  float: right;
}
section.skills .progressBar {
  height: 5px;
  background: #fae1e1;
  border-radius: 2px;
  margin: 4px 0 40px;
  overflow: hidden;
}
section.skills .progressBar > .progress {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
}
section.skills .progressBar > .progress2 {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(red),
    to(blue)
  ); /** Chrome Safari **/
}

section.skills .progressBar > .progress3 {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(skyblue),
    to(pink)
  ); /** Chrome Safari **/
}

section.skills .progressBar > .progress4 {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(black),
    to(grey)
  ); /** Chrome Safari **/
}

section.skills .progressBar > .progress5 {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(pink),
    to(yellow)
  ); /** Chrome Safari **/
}
section.skills .progressBar > .progress6 {
  height: 100%;
  background: #e6686a;
  width: 70%;
  border-radius: 2px;
  transform: translateX(0);
  transition: all 1s;
  background: -webkit-gradient(
    linear,
    50% 50%,
    70% 100%,
    from(red),
    to(#006495)
  ); /*谷歌*/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(#2e98ff),
    to(#9276f7)
  ); /** Chrome Safari **/
  background: -webkit-gradient(
    linear,
    0 100%,
    100% 100%,
    from(blue),
    to(yellow)
  ); /** Chrome Safari **/
}
section.skills.offset .progress {
  transform: translateX(-100%);
  background-image: linear-gradient(180deg, white 50%, red 50%);
}

section.portfolio {
  text-align: center;
  margin-bottom: 100px;
}
section.portfolio > nav {
  text-align: center;
}
section.portfolio > nav > ol {
  margin: 0 auto;
  display: inline-block;
  vertical-align: top;
}
section.portfolio > nav > ol > li {
  float: left;
  margin-left: 40px;
  cursor: pointer;
}
section.portfolio > nav > ol > li:first-child {
  margin-left: 0;
}
section.portfolio > nav {
  display: inline-block;
  vertical-align: top;
  margin-top: 32px;
}
section.portfolio > nav .bar {
  height: 5px;
  background: white;
  margin-top: 5px;
  margin-bottom: 28px;
  border-radius: 2px;
}
section.portfolio > nav .bar-inner {
  height: 100%;
  background: #e6686a;
  border-radius: 2px;
  transition: all 0.5s;
}
section.portfolio > nav .bar.state-1 .bar-inner {
  margin-left: 0;
  width: 50px;
}
section.portfolio > nav .bar.state-2 .bar-inner {
  margin-left: 65px;
  width: 50px;
}
section.portfolio > nav .bar.state-3 .bar-inner {
  margin-left: 140px;
  width: 96px;
}
section.portfolio .works {
  position: relative;
}
section.portfolio .works > .big,
section.portfolio .works > .small {
  position: absolute;
}

.mycode {
  border-top: 2px solid skyblue;
  margin: 40px 0;
}
</style>
